package com.Animations;


import android.graphics.PorterDuff;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.ImageView;
import com.shareup.R;


public class ImageClicker implements OnTouchListener {

    private ImageView image;

    public ImageClicker(ImageView image) {

        super();
        this.image = image;
    }

    @Override
    public boolean onTouch(View v, MotionEvent event) {

        if (event.getAction() == MotionEvent.ACTION_DOWN) {
            image.setColorFilter(image.getResources().getColor(R.color.main), PorterDuff.Mode.MULTIPLY);
        }
        else
            if (event.getAction() == MotionEvent.ACTION_UP) {
                image.setColorFilter(null);
            }
        return false;
    }
}
